<!--  -->
<template>
	<div class="task-record-allot">
			<i18n path="common.record.task.allot" tag="h5">
				<recordUserName place="operator" :user-id="itemData.userId" :user-name="itemData.userName" :staff-id="itemData.staffId" />
				<span place="taskNo">{{ itemData.taskNo }}</span>
				<span place="recipient">
					{{ content.serviceProviderName ? `${$t('common.base.serviceProvider')}#${content.serviceProviderName}-` : '' }}
					<recordUserName  :user-id="itemData.executorId" :user-name="itemData.executorName" :staff-id="itemData.executorStaffId" />
				</span>
				<div><stringChangeArray :item-data="content.overRecords" /></div>
				<div>
					<div v-if="content.synergy">
						{{$t('common.fields.synergies.displayName')}}:<span v-if="isOpenData && content.synergyStaffId && synergy != '自动审批'">
							<open-data v-for="item in synergyStaffId" :key="item" type="userName" :openid="item"></open-data>
						</span><span v-else>{{ content.synergy }}</span>
					</div>
				</div>
			</i18n>
	</div>
</template>

<script>
import { defineComponent, ref, computed } from 'vue';

import recordUserName from './recordUserName.vue'
import stringChangeArray from './stringChangeArray.vue'
import { isOpenData } from '@src/util/platform';
export default defineComponent({
	props:{
		itemData:{
			type:Object,
			defautl:()=>({})
		},
		mode:{
			type:String,
			defautl:''
		}
	},
	components:{
		recordUserName,
		stringChangeArray
	},
  setup(props, { emit }) {
		const content = computed(()=>props.itemData.content || {})
		const synergyStaffId = computed(()=>{
			let ids = [];
			ids = props.itemData.content?.synergyStaffId.split(',') || []
			return ids
		})
		return {
			content,
			synergyStaffId
		}
	},
});
</script>
<style lang="scss" scoped></style>
